package com.xyzwps.server.paimon.model.service

import com.xyzwps.server.paimon.model.entity.User
import com.xyzwps.server.paimon.model.repository.UserRepository
import com.xyzwps.server.paimon.value.UserId
import org.springframework.stereotype.Service

@Service
class UserDomainService(private val userRepository: UserRepository) {

    fun getById(id: UserId): User? = userRepository.findById(id)

    fun getByIds(ids: List<UserId>): List<User> = userRepository.findAllById(ids)

    fun save(user: User): User = userRepository.save(user)
}
